<?php

namespace App\FreeBird\Providers;
use App\FreeBird\Contracts\AutomaticInterface;
use App\FreeBird\Contracts\CollectionInterface;
use App\FreeBird\Contracts\CustomerServiceInterface;
use App\FreeBird\Contracts\InfoClassInterface;
use App\FreeBird\Contracts\InfoComplaintInterface;
use App\FreeBird\Contracts\InfoInterface;
use App\FreeBird\Contracts\NavigationInterface;
use App\FreeBird\Contracts\PunchInterface;
use App\FreeBird\Contracts\RebateLogInterface;
use App\FreeBird\Contracts\ScoreInterface;
use App\FreeBird\Contracts\StoreInterface;
use App\FreeBird\Contracts\StoreUserInterface;
use App\FreeBird\Contracts\VipShopInterface;
use App\FreeBird\Repositories\DbAutomaticRepositories;
use App\FreeBird\Repositories\DbCollectionRepositories;
use App\FreeBird\Repositories\DbCustomerServiceRepositories;
use App\FreeBird\Repositories\DbInfoClassRepositories;
use App\FreeBird\Repositories\DbInfoComplaintRepositories;
use App\FreeBird\Repositories\DbInfoRepositories;
use App\FreeBird\Repositories\DbNavigationRepositories;
use App\FreeBird\Repositories\DbPunchRepositories;
use App\FreeBird\Repositories\DbRebateLogRepositories;
use App\FreeBird\Repositories\DbScoreRepositories;
use App\FreeBird\Repositories\DbStoreRepositories;
use App\FreeBird\Repositories\DbStoreUserRepositories;
use App\FreeBird\Repositories\DbVipshopRepositories;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;


class FreeBirdServiceProvider extends ServiceProvider
{
    protected $admin_namespace = 'App\FreeBird\Controllers\Admin';
    protected $home_namespace = 'App\FreeBird\Controllers\Home';
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //后台管理
        Route::middleware('web')
            ->namespace($this->admin_namespace)
            ->group(__DIR__."/../admin_routes.php");
        //前台管理
        Route::middleware('web')
            ->namespace($this->home_namespace)
            ->group(__DIR__."/../routes.php");
//        require __DIR__.'/../routes.php';
//        require __DIR__.'/../admin_routes.php';
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind(InfoClassInterface::class, DbInfoClassRepositories::class); //信息分类
        $this->app->bind(InfoInterface::class, DbInfoRepositories::class); //信息接口
        $this->app->bind(StoreUserInterface::class, DbStoreUserRepositories::class); //用户接口
        $this->app->bind(StoreInterface::class, DbStoreRepositories::class); //商户列表
        $this->app->bind(ScoreInterface::class, DbScoreRepositories::class); //金币操作
        $this->app->bind(VipShopInterface::class, DbVipshopRepositories::class); //vip商品列表
        $this->app->bind(CustomerServiceInterface::class, DbCustomerServiceRepositories::class); //客服操作
        $this->app->bind(PunchInterface::class, DbPunchRepositories::class); //打卡操作
        $this->app->bind(NavigationInterface::class, DbNavigationRepositories::class); //我的导航操作
        $this->app->bind(CollectionInterface::class, DbCollectionRepositories::class); //收藏夹
        $this->app->bind(RebateLogInterface::class, DbRebateLogRepositories::class); //返佣日志表
        $this->app->bind(InfoComplaintInterface::class, DbInfoComplaintRepositories::class); //投诉接口
        $this->app->bind(AutomaticInterface::class, DbAutomaticRepositories::class); //自动接单
    }
}
